package com.greendragon.service.backend; 

import java.util.List;

import com.greendragon.persistence.domain.User;
import com.greendragon.persistence.enmu.FetchUserType;
import com.greendragon.persistence.enmu.UserRoleType;

/** 
 * @author wulibin, exceptsky@gmail.com, 2011-9-9 下午07:08:11
 * 
 */
public interface IUserBackendService extends IBaseBackendService<User>{
	
	public boolean login(String name, String pw);
	
	public boolean register(User user);
	
	public User getByName(String name);
	
	public String getSecurityQuestion(long uid);
	
	public String getSecurityAnswer(long uid);
	
	public long getCountByRole(UserRoleType role);
	
	public long getCountByType(FetchUserType type);
	
	public List<User> getUsersByRole(UserRoleType role, int page);
	/*user, admin, block, inactive*/
	public List<User> getUsersByType(FetchUserType type, int page);
	
	public List<User> searchByName(String name, int page);
	
	public long countOfSearch(String name);
	
	public User updatePassword(User user, String oldPw, String newPw)throws Exception;
}
 